cmake_minimum_required(VERSION 3.4.1)

set(CMAKE_CXX_FLAGS "-std=c++11 -O3")


set(CMAKE_PREFIX_PATH "/home/wei/AA_ubuntu/Libs/opencv-4.1.2/install")
set(OpenCV_INCLUDE_DIRS "/home/wei/AA_ubuntu/Libs/opencv-4.1.2/install/include") 
find_package(OpenCV REQUIRED)

set(MNN_HOME "./third_parties/MNN_v0.2.2.3")
set(MNN_LIB_DIR ${MNN_HOME}/lib)
set(MNN_INCLUDE_DIR ${MNN_HOME}/include/MNN)

link_directories(${MNN_LIB_DIR})

add_library(
    facedetector-mtcnn
    SHARED
    "./src/imgProcess.cpp"
    "./src/Bbox.cpp"
    "./src/mtcnn.cpp"
    "./src/net.cpp"
)

message(${MNN_INCLUDE_DIR})

target_include_directories(facedetector-mtcnn PRIVATE ${MNN_INCLUDE_DIR})
target_link_libraries(facedetector-mtcnn MNN  ${OpenCV_LIBS})

# example
add_executable(
    facedetect-demo
    "./example-app/main.cpp"
)
target_link_libraries(facedetect-demo facedetector-mtcnn MNN  ${OpenCV_LIBS})
target_include_directories(facedetect-demo PRIVATE ${MNN_INCLUDE_DIR})


# pydetector
add_subdirectory("./pydetector_mtcnn")

